//
// 作者:fudr
// 时间:2016-10-09
// 描述:操作日志
//
$("#start_date").val(getDateTime(0, getLastWeek()));
$("#end_date").val(getDateTime(0));
var tr_order_str = ''; //订单列表de tr
var order_id = getPar('order_id');
var room_type = getPar('room_type');
var refresh_flag = true;
window.onload = function () {
tr_order_str = $('#123').prop('outerHTML'); //获取tr中所有的字符串
getAllSelector();
getLogInfo();
toOrderDetail()
};
function getAllSelector() {
var apiurl = base_api + "?type=log_LogLogInformation&name=getAllSelector";
ZZLog(apiurl);
$.getJSON(apiurl, function (res_data) {
ZZLog(res_data);
var area_list = res_data['result'];
//alert(area_list);
var areaHTML = '';
for (var i = 0, m = area_list.length; i < m; i++) {
var tempDict = area_list[i];
var tempHTML = '';
tempHTML = tempHTML.replace('全部', tempDict['user_name']);
tempHTML = tempHTML.replace('value="0"', 'value=' + tempDict['id']);
areaHTML += tempHTML;
}
$('#operator').html(areaHTML);
})
}
function getLogInfo() {
var name = "getHotelDetail";
var operator = $('#operator').val();
if(refresh_flag){
var startDate = "2016-01-01";
var endDate = "2099-12-31";
}else{
var startDate = $('#start_date').val();
var endDate = $('#end_date').val();
}
refresh_flag = false;
order_id = getPar('order_id');
var apiurl = base_api + "?type=log_LogLogInformation&name=" + name + "&operator=" + operator + "&startDate=" + startDate + "&endDate=" + endDate + "&order_id=" + order_id;
ZZLog(apiurl);
$.getJSON(apiurl, function (res_data) {
ZZLog(res_data);
// if (res_data['code'] != "0") {
// alert(res_data['info']);
// } else {
//地区
//alert(1);
var area_list = res_data['result'];
//alert(area_list);
var areaHTML = '';
for (var i = 0, m = area_list.length; i < m; i++) {
var tempDict = area_list[i];
var tempHTML = tr_order_str;
if (tempDict['room_name'] === null) {
tempHTML = tempHTML.replace('湖景大床房', "-");
} else {
tempHTML = tempHTML.replace('湖景大床房', tempDict['room_name']);
}
tempHTML = tempHTML.replace('操作人', tempDict['user_name']);
tempHTML = tempHTML.replace('操作时间', tempDict['create_time']);
tempHTML = tempHTML.replace('操作内容', tempDict['log_desc']);
areaHTML += tempHTML;
}
//alert(1);
$('#tableOrder').html(areaHTML);
// }
})
}
function toOrderDetail() {
$('#detail').on('click', function () {
var order_id = getPar('order_id');
var order_status = getPar('order_status');
var org_id = getPar('org_id');
var hotel_id = getPar('hotel_id');
var org_name = getPar('org_name');
window.location.href = "./hotel_order_detail.html?order_id=" + order_id + "&order_status=" + order_status + "&org_id=" + org_id + "&hotel_id=" + hotel_id + "&org_name=" + org_name + "&room_type=" + room_type;
})
}